<template>
  <div class="contents">
    <PanelTitle title="种植总览" />
    <div class="infoPanel mt">
      <div>
        <div class="infoTitle">太子参种植面积</div>
        <div class="infoNumss">
          <span class="infoNum">{{ data.acreage }}</span>
          <span class="infoUnit">亩</span>
        </div>
      </div>
      <div>
        <div class="infoTitle">太子参种植批次</div>
        <div class="infoNumss">
          <span class="infoNum">{{ data.batchNum }}</span>
          <span class="infoUnit">批</span>
        </div>
      </div>
      <div>
        <div class="infoTitle">太子参品种</div>
        <div class="infoNumss">
          <span class="infoNum">{{ data.medicinalNum }}</span>
          <span class="infoUnit">类</span>
        </div>
      </div>
      <div>
        <div class="infoTitle">太子参预期产量</div>
        <div class="infoNumss">
          <span class="infoNum">{{ data.expectYield }}</span>
          <span class="infoUnit">吨</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, onMounted } from "vue";
import http from "@/api/http";
import { env } from "@/utils/env";
import PanelTitle from "../../component/PanelTitle.vue";
import { useBaseStore } from "@/stores/base";
const baseStore = useBaseStore()
const data = ref({})
onMounted(async () => {
  let res = await http({
    url: env.VITE_ZHER_DATA_CENTER + "/base/land/res/statist",
    method: "get",
    params: { 
      baseId: baseStore.base.id,
      year: new Date().getFullYear()
    },
  });
  data.value = res.data.plantTaskStatist
  
});


</script>

<style scoped lang="scss">
.contents {
  background: linear-gradient(
    to bottom,
    rgba(5, 79, 99),
    rgba(5, 79, 99, 0.1),
    rgba(5, 79, 99)
  );
  border-radius: vh(8);
  border: vh(1) solid rgba(6, 112, 180, 1);
  .mt {
    margin-top: vh(-40);
  }
}
.infoPanel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: vh(10) vw(15) 0px;

  > div {
    box-sizing: border-box;
    width: vw(160);
    height: vh(80);
    background: rgba(9, 36, 44, 0.4);
    border: vh(1) solid #43e7ff;
    padding: 0 vw(20) 0px;
    margin-bottom: vh(10);
  }
  .infoTitle {
    color: #fff;
    font-size: vh(10);
    line-height: vh(30);
  }
  .infoNums {
    line-height: vh(20);
  }
  .infoNumss {
    line-height: vh(36);
  }
  .infoNum {
    color: #adffd7;
    font-size: vh(26);
    font: SourceHanSansCN-Bold;
  }
  .infoUnit {
    color: #adffd7;
    font-size: vh(16);
    font: SourceHanSansCN-Bold;
    margin-left: vw(4);
  }
  .infoSub {
    font-weight: 400;
    font-size: vh(10);
    color: #adffd7;
    line-height: vh(20);
  }
}
</style>